
import Vue from 'vue'
import Vuex from 'vuex'
import utils from '@/utils/utils.js'
Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
        menu: '/',
        islogin: false,
        searchkey: '',
    },
    getters: {
        count (state) {
            return state.count
        }
    },
    mutations: {
        addCount (state, num) {
            state.count += num
        },
        changeLoginStatus (state, status) {
            state.islogin = status
            utils.setlocStore('isLogin', status)
        },
        changeSearchKey (state, val) {
            state.searchkey = val
        }
    },
    actions: {}
})

export default store